<?php
global $base_dir;
$base_dir='../../';

/**** 模块调用*****/
include_once($base_dir."inc/inc_connect.php");		//通用函数包含文件

include_once("index_inc.php");
include_once("func/function.php");
include_once($base_dir."inc/manage.php");			//后台通用包含文件
include_once($base_dir."../api/file_api.php");			//文件处理接口
?>
<?php
if(is_array($_POST))
{
	foreach($_POST as $key => $value)
	{
		$$key=$value;
	}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>城市js更新</title>
</head>
<body>
<?php

$sql=" select name,quanpin,code from area_city where quanpin<>'' order by quanpin asc";
$rs=$db->Execute($sql);
$str='function search_citydata()
{
	var ss="';
$i=0;
while($rs && $row=$rs->FetchRow())
{
	$arytemp[$i]=$row['name'].'|'.$row['quanpin'].'|'.$row['code'];
	$i++;
}
if(is_array($arytemp))
{
	$str.=implode("@",$arytemp);
}
$str.='";
	return ss;
}';

if(createfile('../../../javascript/city/','citydata.js',$str))
{
	echo "更新成功！<br/><br/>当前热点城市代码:<br/>";
	$sql=" select name,quanpin,code from area_city where quanpin<>'' and ishot=1 order by quanpin asc";
	$rs=$db->Execute($sql);
	$i=0;
	unset($arytemp);
	while($rs && $row=$rs->FetchRow())
	{
		$arytemp[$i]=$row['name'].'|'.$row['quanpin'].'|'.$row['code'];
		$i++;
	}
	if(is_array($arytemp))
	{
		$ss=implode("@",$arytemp);
	}
	echo $ss;
}
?>
<!-- 7caihu.com Baidu tongji analytics -->
<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");

document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fb8797ecb21d1ccb839c35b190277a0cd' type='text/javascript'%3E%3C/script%3E"));

</script>
</body>
</html>
<?php
include_once($base_dir."inc/inc_unconnect.php")
?>